<template>
    <div class="container">
        <div class="channel-detail">
            <header>
                <router-link to="/">首页 / </router-link>
                <router-link :to="{ path: '/partner/company', query: { id: userId }}">企业管理 / </router-link>
                <router-link :to="{ path: '/partner/companyDetail', query: { id: userId }}">{{name?name:'--'}}/ </router-link>
                财务信息
            </header>
            <div v-if="messageList.length > 0" class="focus-pointer mb30">
                <div class="flex-box-align" style="padding-left: 18px; position: relative; width: 100%;">
                    今日要事：
                    <div class="message">
                        <ul class="marquee_list" :style="{ top: -num + 'px'}" :class="{marquee_top:num}">
                            <li v-for="(item, index) in messageList" :key="index" v-if="messageList && messageList.length">
                                <router-link :to="{name: item.route}">{{item.showMsg}}</router-link>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="balance-edit">
                <div class="balance-head">
                    <div class="balance-title">新增资产负债表</div>
                    <div class="balance-search">
                        <div class="balance-item">
                            报表时间：
                           <el-date-picker
                            v-model="information.rptDate"
                            type="month"
                            format="yyyy 年 MM 月"
                            value-format="yyyy-MM"
                            placeholder="选择报表时间">
                            </el-date-picker>
                            <div v-show="errorState" class="error-tip">请选择报表时间</div>
                        </div>
                        <div class="balance-item">
                            报表主体：
                           <el-select v-model="information.associationId" filterable>
                                <el-option
                                label="主体公司"
                                :value="0"></el-option>
                                <el-option
                                v-for="item in companyArr"
                                :key="item.id"
                                :label="item.associatedCompanyName"
                                :value="item.id">
                                </el-option>
                            </el-select>
                            <!-- <div v-show="errorState1" class="error-tip">请输入报表主体</div> -->
                        </div>
                        <div class="balance-item">
                            报表是否审计：
                           <el-select  filterable v-model="information.isCheck">
                                <el-option label="是" value="y"></el-option>
                                <el-option label="否" value="n"></el-option>
                            </el-select>
                            <div v-show="errorState2" class="error-tip">请选择报表是否审计</div>
                        </div>
                        <div class="balance-item">
                            报表币种：
                           <el-select  filterable v-model="information.currency">
                               <el-option
                                v-for="item in giveArr"
                                :key="item.key"
                                :label="item.value"
                                :value="item.key">
                                </el-option>
                            </el-select>
                             <div v-show="errorState3" class="error-tip">请选择报表币种</div>
                        </div>
                        <div class="balance-item">
                            报表附件：
                           <el-upload
                            class="upload-demo"
                            :action="upLoadUrl"
                            :on-remove="handleRemove"
                            :show-file-list="false"
                            :on-success="handleFileSuccess">
                                <div class="btn">上传</div>
                            </el-upload>
                             <div class="file-name"><a style="color:#F8B100" :href="information.attachmentFile?information.attachmentFile.fileUrl:''">{{fileName}}</a></div>
                        </div>
                    </div>
                </div>
                <div class="balance-wrap">
                     <el-form :model="information" :rules="rules" ref="information" >
                        <div class="balance-line">
                            <el-form-item prop="bankCash">
                                <div class="balance-item">
                                    <span>货币资金：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.bankCash" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="tradableFinAssets">
                                <div class="balance-item">
                                    <span>交易性金融资产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.tradableFinAssets" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="notesReceivable">
                                <div class="balance-item">
                                    <span>应收票据：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.notesReceivable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="accountReceivable">
                                <div class="balance-item">
                                    <span>应收账款：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.accountReceivable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="otherReceivable">
                                <div class="balance-item">
                                    <span>其他应收款：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.otherReceivable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="prepayment">
                                <div class="balance-item">
                                    <span>预付账款：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.prepayment" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="dvdRcv">
                                <div class="balance-item">
                                    <span>应收股利：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.dvdRcv" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="intRcv">
                                <div class="balance-item">
                                    <span>应收利息：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.intRcv" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="redMonetaryCapForSale">
                                <div class="balance-item">
                                    <span>买入返售金融资产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.redMonetaryCapForSale" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="inventory">
                                <div class="balance-item">
                                    <span>存货：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.inventory" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="consumpitveBioAssets">
                                <div class="balance-item">
                                    <span>其中：消耗性生物资产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.consumpitveBioAssets" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="deferredExp">
                                <div class="balance-item">
                                    <span>待摊费用：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.deferredExp" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="hfsAssets">
                                <div class="balance-item">
                                    <span>划分为持有待售的资产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.hfsAssets" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="nonCurAssetsDueWithin1y">
                                <div class="balance-item">
                                    <span>一年到期内的非流动资金：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.nonCurAssetsDueWithin1y" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="otherAssets">
                                <div class="balance-item">
                                    <span>其他流动资产：</span> 
                                    <div  class="tip"><el-input type="number" v-model="information.otherAssets" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="otherAssets">
                                <div class="balance-item balance-title">
                                    <span>流动资产合计：</span> 
                                    <div  class="tip">{{totalNum?formateMoney(totalNum)+'元':'0'}}</div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="finAssetsAvailForSale">
                                <div class="balance-item">
                                    <span>可供出售金融资产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.finAssetsAvailForSale" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="heldToMtyInvest">
                                <div class="balance-item">
                                    <span>持有至到期投资：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.heldToMtyInvest" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="investRealEstate">
                                <div class="balance-item">
                                    <span>投资性房地产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.investRealEstate" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="longtermInvestment">
                                <div class="balance-item">
                                    <span>长期股权投资：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.longtermInvestment" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="longTermRec">
                                <div class="balance-item">
                                    <span>长期应收款：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.longTermRec" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="netBal">
                                <div class="balance-item">
                                    <span>固定资产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.netBal" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="projMatl">
                                <div class="balance-item">
                                    <span>工程物资：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.projMatl" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="constructionInprogress">
                                <div class="balance-item">
                                    <span>在建工程：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.constructionInprogress" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item> 
                            <el-form-item prop="fixAssetsDisp">
                                <div class="balance-item">
                                    <span>固定资产清理：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.fixAssetsDisp" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="productiveBioAssets">
                                <div class="balance-item">
                                    <span>生产性生物资产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.productiveBioAssets" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="oilAndNaturalGasAssets">
                                <div class="balance-item">
                                    <span>油气资产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.oilAndNaturalGasAssets" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="intangibleAssets">
                                <div class="balance-item">
                                    <span>无形资产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.intangibleAssets" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="rAndDCosts">
                                <div class="balance-item">
                                    <span>开发支出：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.rAndDCosts" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="goodwill">
                                <div class="balance-item">
                                    <span>商誉：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.goodwill" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="longtermDeferredExpense">
                                <div class="balance-item">
                                    <span>长期待摊费用：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.longtermDeferredExpense" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="deferredTaxAssets">
                                <div class="balance-item">
                                    <span>递延所得税资产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.deferredTaxAssets" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="othNonCurAssets">
                                <div class="balance-item">
                                    <span>其他非流动资产：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.othNonCurAssets" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item>
                                <div class="balance-item balance-title">
                                    <span>非流动资产合计：</span> 
                                    <div  class="tip">{{totalNum1?formateMoney(totalNum1)+'元':'0'}}</div>
                                </div>
                            </el-form-item>
                            <el-form-item>
                                <div class="balance-item balance-title">
                                    <span>资产总计：</span> 
                                    <div  class="tip">{{totalNum2?formateMoney(totalNum2)+'元':'0'}}</div>
                                </div>
                            </el-form-item>
                        </div>
                        <div class="balance-line">
                            <el-form-item prop="shorttermLoans">
                                <div class="balance-item">
                                    <span>短期借款：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.shorttermLoans" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="tradableFinLiab">
                                <div class="balance-item">
                                    <span>交易性金融负债：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.tradableFinLiab" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="notesPayable">
                                <div class="balance-item">
                                    <span>应付票据：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.notesPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="acctPayable">
                                <div class="balance-item">
                                    <span>应付账款：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.acctPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="accountsPayable">
                                <div class="balance-item">
                                    <span>应付款项：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.accountsPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="advanceFromCustomers">
                                <div class="balance-item">
                                    <span>预收账款：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.advanceFromCustomers" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="emplBenPayable">
                                <div class="balance-item">
                                    <span>应付职工薪酬：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.emplBenPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="taxesPayable">
                                <div class="balance-item">
                                    <span>应交税费：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.taxesPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="intPayable">
                                <div class="balance-item">
                                    <span>应付利息：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.intPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="dvdPayable">
                                <div class="balance-item">
                                    <span>应付股利：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.dvdPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="otherPayable">
                                <div class="balance-item">
                                    <span>其他应付款：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.otherPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="accExp">
                                <div class="balance-item">
                                    <span>预提费用：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.accExp" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="deferredIncCurLiab">
                                <div class="balance-item">
                                    <span>递延收益-流动负债：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.deferredIncCurLiab" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="hfsLiab">
                                <div class="balance-item">
                                    <span>划分为持有待售的负债：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.hfsLiab" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="nonCurLiabDueWithin1y">
                                <div class="balance-item">
                                    <span>一年到期内的非流动负债：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.nonCurLiabDueWithin1y" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="otherCurrentLiability">
                                <div class="balance-item">
                                    <span>其他流动负债：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.otherCurrentLiability" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item>
                                <div class="balance-item balance-title">
                                    <span>流动负债合计：</span> 
                                    <div  class="tip">{{totalNum3?formateMoney(totalNum3)+'元':'0'}}</div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="longtermLoans">
                                <div class="balance-item">
                                    <span>长期借款：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.longtermLoans" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="bondsPayable">
                                <div class="balance-item">
                                    <span>应付债券：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.bondsPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="ltPayable">
                                <div class="balance-item">
                                    <span>长期应付款：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.ltPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="ltEmplBenPayable">
                                <div class="balance-item">
                                    <span>长期应付职工薪酬：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.ltEmplBenPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="specificItemPayable">
                                <div class="balance-item">
                                    <span>专项应付款：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.specificItemPayable" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="provisions">
                                <div class="balance-item">
                                    <span>预计负债：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.provisions" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="deferredTaxLiab">
                                <div class="balance-item">
                                    <span>递延所得税负债：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.deferredTaxLiab" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="deferredIncNonCurLiab">
                                <div class="balance-item">
                                    <span>递延收益-非流动负债：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.deferredIncNonCurLiab" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="othNonCurLiab">
                                <div class="balance-item">
                                    <span>其他非流动负债：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.othNonCurLiab" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item>
                                <div class="balance-item balance-title">
                                    <span>非流动负债合计：</span> 
                                    <div  class="tip">{{totalNum4?formateMoney(totalNum4)+'元':'0'}}</div>
                                </div>
                            </el-form-item>
                            <el-form-item>
                                <div class="balance-item balance-title">
                                    <span>负债合计：</span> 
                                    <div  class="tip">{{totalNum5?formateMoney(totalNum5)+'元':'0'}}</div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="netBa">
                                <div class="balance-item">
                                    <span>实收资本（或股本）：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.netBa" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="capitalReserves">
                                <div class="balance-item">
                                    <span>资本公积：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.capitalReserves" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="surplusReserves">
                                <div class="balance-item">
                                    <span>盈余公积：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.surplusReserves" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="retainedProfits">
                                <div class="balance-item">
                                    <span>未分配利润：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.retainedProfits" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="tsyStk">
                                <div class="balance-item">
                                    <span>库存股：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.tsyStk" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="otherComprehIncBs">
                                <div class="balance-item">
                                    <span>其他综合收益：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.otherComprehIncBs" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="specialRsrv">
                                <div class="balance-item">
                                    <span>专项储备：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.specialRsrv" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="provNomRisks">
                                <div class="balance-item">
                                    <span>一般风险准备：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.provNomRisks" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="cnvdDiffForeignCurrStat">
                                <div class="balance-item">
                                    <span>外币报表折算差额：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.cnvdDiffForeignCurrStat" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="unconfirmedInvestLossBs">
                                <div class="balance-item">
                                    <span>未确认的投资损失：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.unconfirmedInvestLossBs" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="minorityInt">
                                <div class="balance-item">
                                    <span>少数股东权益：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.minorityInt" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item prop="eqyBelongtoParcomsh">
                                <div class="balance-item">
                                    <span>归属于母公司股东的权益：</span>
                                    <div  class="tip"><el-input type="number" v-model="information.eqyBelongtoParcomsh" placeholder="请输入数字，单位元"></el-input></div>
                                </div>
                            </el-form-item>
                            <el-form-item>
                                <div class="balance-item balance-title">
                                    <span>所有者权益合计：</span> 
                                    <div  class="tip">{{totalNum6?formateMoney(totalNum6)+'元':'0'}}</div>
                                </div>
                            </el-form-item>
                            <el-form-item>
                                <div class="balance-item balance-title">
                                    <span>负债及股东权益合计：</span> 
                                    <div  class="tip">{{totalNum7?formateMoney(totalNum7)+'元':'0'}}</div>
                                </div>
                            </el-form-item>
                        </div>
                     </el-form>
                     <div class="btns-bottom">
                        <div @click="confrimBtn('information')" class="btn">保存</div>
                       <div @click="$router.push('/partner/financialInfo_v2/financialBalance?id='+userId+'&name='+name )" class="btn-cancel">取消</div>
                     </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import CONSTANT from '../../constant/constant.js'
import common from '../../common.js'
import { formateMoney } from '../../common.js'
export default {
  data() {
    var validateNum =  (rule, value, callback) => { 
        if (isNaN(value)){ return callback(new Error('请输入数字')); }
        // var reg= /^(-?\d+)(\.\d{1,2})?$/
        // if (!reg.test(value)){ return callback(new Error('请保留两位小数')); }
        callback();
    };
    return{
      num: 0,
      messageList: [],
      name:'',
      active: 0,
      tabConfig: [
        {
          name: 'financialReportAnalysis',
          text: '财务分析'
        },
        {
          name: 'financialBalance',
          text: '资产负债表'
        },
        {
          name: 'financialProfit',
          text: '利润表'
        },
        {
          name: 'financialCashflow',
          text: '现金流量表'
        },
        {
          name: 'financialOther',
          text: '补充信息'
        }
      ],
      information:{
        'associationId':'',
        "accExp": '',
        "accountReceivable": '',
        "accountsPayable": '',
        "acctPayable": '',
        "advanceFromCustomers": '',
        "attachmentId": "",
        "bankCash": '',
        "bondsPayable": '',
        "capitalReserves": '',
        "cnvdDiffForeignCurrStat": '',
        "constructionInprogress": '',
        "consumpitveBioAssets": '',
        "currency": "",
        "currentAssets": '',
        "currentInvestment": '',
        "deferredExp": '',
        "deferredIncCurLiab": '',
        "deferredIncNonCurLiab": '',
        "deferredTaxAssets": '',
        "deferredTaxLiab": '',
        "dvdPayable": '',
        "dvdRcv": '',
        "emplBenPayable": '',
        "eqyBelongtoParcomsh": '',
        "finAssetsAvailForSale": '',
        "fixAssetsDisp": '',
        "goodwill": '',
        "heldToMtyInvest": '',
        "hfsAssets": '',
        "hfsLiab": '',
        "id": '',
        "intPayable": '',
        "intRcv": '',
        "intangibleAssets": '',
        "inventory": '',
        "investRealEstate": '',
        "isCheck": "",
        "longTermRec": '',
        "longtermDeferredExpense": '',
        "longtermInvestment": '',
        "longtermLoans": '',
        "ltEmplBenPayable": '',
        "ltPayable": '',
        "minorityInt": '',
        "netBa": '',
        "netBal": '',
        "nonCurAssetsDueWithin1y": '',
        "nonCurLiabDueWithin1y": '',
        "notesPayable": '',
        "notesReceivable": '',
        "oilAndNaturalGasAssets": '',
        "othNonCurAssets": '',
        "othNonCurLiab": '',
        "otherAssets": '',
        "otherComprehIncBs": '',
        "otherCurrentLiability": '',
        "otherPayable": '',
        "otherReceivable": '',
        "prepayment": '',
        "productiveBioAssets": '',
        "projMatl": '',
        "provNomRisks": '',
        "provisions": '',
        "rAndDCosts": '',
        "redMonetaryCapForSale": '',
        "retainedProfits": '',
        "rptDate": "",
        "rptMaster": "",
        "shorttermLoans": '',
        "specialRsrv": '',
        "specificItemPayable": '',
        "surplusReserves": '',
        "taxesPayable": '',
        "totAcctRcv": '',
        "totAssets": '',
        "totEquity": '',
        "totLiab": '',
        "totLiabShrhldrEqy": '',
        "totNonCurAssets": '',
        "totNonCurLiab": '',
        "totalCurrentLiability": '',
        "totalLongtermLiability": 0,
        "tradableFinAssets": '',
        "tradableFinLiab": '',
        "tsyStk": '',
        "unconfirmedInvestLossBs": '',
        "userId": ''
      },
      giveArr:[],
      upLoadUrl:'',
      fileName:'',
      rules:{ 
        bankCash:[
           //{required: true, message: '请输入货币资金', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        tradableFinAssets:[
           // {required: true, message: '请输入交易性金融资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        notesReceivable:[
           // {required: true, message: '请输入应收票据', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        accountReceivable:[
           // {required: true, message: '请输入应收账款', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        otherReceivable :[
            //{required: true, message: '请输入其他应收款', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        prepayment:[
          //  {required: true, message: '请输入预付账款', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        dvdRcv:[
            //{required: true, message: '请输入应收股利', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
       intRcv:[
          //  {required: true, message: '请输入应收利息', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        redMonetaryCapForSale:[
            //{required: true, message: '请输入买入返售金融资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        inventory:[
           // {required: true, message: '请输入存货', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        consumpitveBioAssets:[
         //   {required: true, message: '请输入其中：消耗性生物资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        deferredExp:[
            //{required: true, message: '请输入待摊费用', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        hfsAssets:[
            //{required: true, message: '请输入划分为持有待售的资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        nonCurAssetsDueWithin1y:[
          //  {required: true, message: '请输入一年到期内的非流动资金', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        otherAssets:[
            //{required: true, message: '请输入其他流动资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],

        finAssetsAvailForSale:[
           // {required: true, message: '请输入可供出售金融资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        heldToMtyInvest:[
           // {required: true, message: '请输入持有至到期投资', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        investRealEstate:[
           // {required: true, message: '请输入投资性房地产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        longtermInvestment:[
           // {required: true, message: '请输入长期股权投资', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        longTermRec:[
          //  {required: true, message: '请输入长期应收款', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        netBal:[
           // {required: true, message: '请输入固定资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        projMatl:[
            //{required: true, message: '请输入工程物资', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        constructionInprogress:[
           // {required: true, message: '请输入在建工程', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        fixAssetsDisp:[
           // {required: true, message: '请输入固定资产清理', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        productiveBioAssets:[
         //   {required: true, message: '请输入生产性生物资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        oilAndNaturalGasAssets:[
           // {required: true, message: '请输入油气资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        intangibleAssets:[
           // {required: true, message: '请输入无形资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        rAndDCosts:[
          //  {required: true, message: '请输入开发支出', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        goodwill:[
           // {required: true, message: '请输入商誉', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        longtermDeferredExpense:[
         //   {required: true, message: '请输入长期待摊费用', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        deferredTaxAssets:[
           // {required: true, message: '请输入递延所得税资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        othNonCurAssets:[
            //{required: true, message: '请输入其他非流动资产', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],

        shorttermLoans:[
          //  {required: true, message: '请输入短期借款', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        tradableFinLiab:[
          //  {required: true, message: '请输入交易性金融负债', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        notesPayable:[
           // {required: true, message: '请输入应付票据', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        acctPayable:[
        //    {required: true, message: '请输入应付账款', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        accountsPayable:[
          //  {required: true, message: '请输入应付款项', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        advanceFromCustomers:[
            //{required: true, message: '请输入预收账款', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        emplBenPayable:[
          //  {required: true, message: '请输入应付职工薪酬', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        taxesPayable:[
           // {required: true, message: '请输入应交税费', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        intPayable:[
           // {required: true, message: '请输入应付利息', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        dvdPayable:[
          //  {required: true, message: '请输入应付股利', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        otherPayable:[
         //   {required: true, message: '请输入其他应付款', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        accExp:[
            //{required: true, message: '请输入预提费用', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        deferredIncCurLiab:[
            //{required: true, message: '请输入递延收益-流动负债', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        hfsLiab:[
           // {required: true, message: '请输入划分为持有待售的负债', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        nonCurLiabDueWithin1y:[
          //  {required: true, message: '请输入一年到期内的非流动负债', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        otherCurrentLiability:[
           // {required: true, message: '请输入其他流动负债', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],

        longtermLoans:[
            {required: true, message: '请输入长期借款', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        bondsPayable:[
        //    {required: true, message: '请输入应付债券', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        ltPayable:[
            //{required: true, message: '请输入长期应付款', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        ltEmplBenPayable:[
           // {required: true, message: '请输入长期应付职工薪酬', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        specificItemPayable:[
         //   {required: true, message: '请输入专项应付款', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        provisions:[
            //{required: true, message: '请输入预计负债', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        deferredTaxLiab:[
            {required: true, message: '请输入递延所得税负债', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        deferredIncNonCurLiab:[
          //  {required: true, message: '请输入递延收益-非流动负债', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        othNonCurLiab:[
           // {required: true, message: '请输入其他非流动负债', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],

        netBa:[
           // {required: true, message: '请输入实收资本', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        capitalReserves:[
           // {required: true, message: '请输入资本公积', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        surplusReserves:[
           // {required: true, message: '请输入盈余公积', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        retainedProfits:[
           // {required: true, message: '请输入未分配利润', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        tsyStk:[
          //  {required: true, message: '请输入库存股', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        otherComprehIncBs:[
           // {required: true, message: '请输入其他综合收益', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        specialRsrv:[
            //{required: true, message: '请输入专项储备', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        provNomRisks:[
          //  {required: true, message: '请输入一般风险准备', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        cnvdDiffForeignCurrStat:[
           // {required: true, message: '请输入外币报表折算差额', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        unconfirmedInvestLossBs:[
            //{required: true, message: '请输入未确认的投资损失', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        minorityInt:[
           // {required: true, message: '请输入少数股东权益', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
        eqyBelongtoParcomsh:[
            //{required: true, message: '请输入归属于母公司股东的权益', trigger: 'change'  },
            {  validator: validateNum, trigger: 'change' }
        ],
      },
      totalNum:'',
      totalNum1:'',
      totalNum2:'',
      totalNum3:'',
      totalNum4:'',
      totalNum5:'',
      totalNum6:'',
      totalNum7:'',
      errorState:false,
      errorState1:false,
      errorState2:false,
      errorState3:false,
      id:'',
      userId:'',
      companyArr:[]
    }
  },
  watch:{
    information:{//深度监听，可监听到对象、数组的变化
        handler(val, oldVal){
          let info = this.information;
          if(info.rptDate){
              this.errorState = false
          }
        //   if(info.rptMaster){
        //       this.errorState1 = false
        //   }
          if(info.isCheck){
              this.errorState2 = false
          }
          if(info.currency){
              this.errorState3 = false
          }
          //流动资产合计  
          let totalNum = {
              bankCash:info.bankCash,
              tradableFinAssets:info.tradableFinAssets,
              notesReceivable:info.notesReceivable,
              accountReceivable:info.accountReceivable,
              otherReceivable:info.otherReceivable,
              prepayment:info.prepayment,
              dvdRcv:info.dvdRcv,
              intRcv:info.intRcv,
              redMonetaryCapForSale:info.redMonetaryCapForSale,
              inventory:info.inventory,
              consumpitveBioAssets:info.consumpitveBioAssets,
              deferredExp:info.deferredExp,
              hfsAssets:info.hfsAssets,
              nonCurAssetsDueWithin1y:info.nonCurAssetsDueWithin1y,
              otherAssets:info.otherAssets
          }
          let num = 0;
          for (let i in totalNum) {
            if (!isNaN(totalNum[i])&&totalNum[i]) {
                   num+=Number(totalNum[i])
            }
          }
          this.totalNum = num;
          //非流动资产合计
          let totalNum1 = {
              finAssetsAvailForSale:info.finAssetsAvailForSale,
              heldToMtyInvest:info.heldToMtyInvest,
              investRealEstate:info.investRealEstate,
              longtermInvestment:info.longtermInvestment,
              longTermRec:info.longTermRec,
              fixAssetsDisp:info.fixAssetsDisp,
              projMatl:info.projMatl,
              netBal:info.netBal,
              constructionInprogress:info.constructionInprogress,
              fixAssetsDisp:info.fixAssetsDisp,
              productiveBioAssets:info.productiveBioAssets,
              oilAndNaturalGasAssets:info.oilAndNaturalGasAssets,
              intangibleAssets:info.intangibleAssets,
              rAndDCosts:info.rAndDCosts,
              goodwill:info.goodwill,
              longtermDeferredExpense:info.longtermDeferredExpense,
              deferredTaxAssets:info.deferredTaxAssets,
              othNonCurAssets:info.othNonCurAssets
          }
          let num1 = 0;
          for (let i in totalNum1) {
            if (!isNaN(totalNum1[i])&&totalNum1[i]) {
                   num1+=Number(totalNum1[i])
            }
          }
          this.totalNum1 = num1;
          //资产总计
          this.totalNum2 = num1+num;
          //流动负债合计
           let totalNum3 = {
              shorttermLoans:info.shorttermLoans,
              tradableFinLiab:info.tradableFinLiab,
              notesPayable:info.notesPayable,
              acctPayable:info.acctPayable,
              accountsPayable:info.accountsPayable,
              advanceFromCustomers:info.advanceFromCustomers,
              emplBenPayable:info.emplBenPayable,
              taxesPayable:info.taxesPayable,
              intPayable:info.intPayable,
              dvdPayable:info.dvdPayable,
              otherPayable:info.otherPayable,
              accExp:info.accExp,
              deferredIncCurLiab:info.deferredIncCurLiab,
              hfsLiab:info.hfsLiab,
              nonCurLiabDueWithin1y:info.nonCurLiabDueWithin1y,
              otherCurrentLiability:info.otherCurrentLiability,
          }
          let num3 = 0;
          for (let i in totalNum3) {
            if (!isNaN(totalNum3[i])&&totalNum3[i]) {
                   num3+=Number(totalNum3[i])
            }
          }
          this.totalNum3 = num3;
           //非流动负债合计
           let totalNum4 = {
              longtermLoans:info.longtermLoans,
              bondsPayable:info.bondsPayable,
              ltPayable:info.ltPayable,
              ltEmplBenPayable:info.ltEmplBenPayable,
              specificItemPayable:info.specificItemPayable,
              provisions:info.provisions,
              deferredTaxLiab:info.deferredTaxLiab,
              deferredIncNonCurLiab:info.deferredIncNonCurLiab,
              othNonCurLiab:info.othNonCurLiab
          }
          let num4 = 0;
          for (let i in totalNum4) {
            if (!isNaN(totalNum4[i])&&totalNum4[i]) {
                   num4+=Number(totalNum4[i])
            }
          }
          this.totalNum4 = num4;
          //资产总计
          this.totalNum5 = num3+num4;
          //所有者权益合计
           let totalNum6 = {
              netBa:info.netBa,
              capitalReserves:info.capitalReserves,
              surplusReserves:info.surplusReserves,
              retainedProfits:info.retainedProfits,
              tsyStk:info.tsyStk,
              otherComprehIncBs:info.otherComprehIncBs,
              specialRsrv:info.specialRsrv,
              provNomRisks:info.provNomRisks,
              cnvdDiffForeignCurrStat:info.cnvdDiffForeignCurrStat,
              unconfirmedInvestLossBs:info.unconfirmedInvestLossBs
          }
          let num6 = 0;
          for (let i in totalNum6) {
            if (!isNaN(totalNum6[i])&&totalNum6[i]) {
                   num6+=Number(totalNum6[i])
            }
          }
          this.totalNum6 = num6;
          //负债及股东权益合计
          this.totalNum7 =  num3+num4+num6 +Number(info.minorityInt)+Number(info.eqyBelongtoParcomsh);
        },
        deep:true
    },
    
  },
  created() {
      for (let i in this.information) {
            this.information[i] = '0'
        }
      this.information.rptDate = '';
      this.information.isCheck = '';
      this.information.currency = '';
      this.information.userId = '';
      this.information.id = '';
      this.information.attachmentId = ''
      this.id = this.$router.currentRoute.query.id;
      this.userId = this.$router.currentRoute.query.userId;
      let sessionId = common.getCookie('sessionId');
      this.upLoadUrl =CONSTANT.URL.SYS.ADMINUPLOAD+ '?sessionId='+sessionId;
      if(this.id){
          this.getDetail()
      }else{
          this.information.associationId = this.$router.currentRoute.query.associationId
      }
      this.findCurrentCompany()
  },
  mounted(){
    this.getDictionary("currency", (data) => {
        this.giveArr = data.data.bussData
    })
    this.name = this.$router.currentRoute.query.name;
    this.information.rptMaster= this.name
    this.getMessage()
    setInterval( () => {
        this.getMessage()
    }, 120000)
  },
  methods:{
      findCurrentCompany(){
        let  url = CONSTANT.URL.FINANCE.FINDCURRENTCOMPANY,
            data = {userId:this.userId},
            dataForm = {}
            common.requestAjax(url,data,dataForm,(res)=>{
            if(res.status == 200){
               this.companyArr = res.data.bussData;
            }else{
            
            }
        })
    },
    formateMoney,
    getMessage() {
      let url = CONSTANT.URL.CALENDAR.MESSAGELIST;
      common.requestAjax(url, {}, {}, (data) => {
        if(data.status == 200) {
          this.messageList = data.data.bussData;
          this.showMarquee(this.num)
        }
      })
    },
    getDictionary(params, callback) {
        let url = CONSTANT.URL.SYS.LOADDICTIONARY;
        common.requestAjax(url, {codeType: params}, {}, callback);
    },
    showMarquee:function (num) {
      if (!this.messageList[0]) return
      this.messageList.push(this.messageList[0]);
      var max = this.messageList.length;
      var that = this;
      let marqueetimer =  setInterval(function(){
        num++;
        if(num>=max ){
            num=0;
        }
        that.num=num*30;
      }, 2000);
    },
    handleAdd(active) {
      //根据显示不同的表的时候跳转到不同的新增页面
      const paths = ['', '/partner/financialInfo_v2/financialBalanceEdit', '/partner/financialInfo_v2/financialReportAnalysisEdit' , '/partner/financialInfo_v2/financeOperatingEdit', '/partner/financialInfo_v2/financeInfoEdit']
      paths[active] && this.$router.push(paths[active])
    },
    getDetail(){
            let url = CONSTANT.URL.SYSTEM.FINDBALANCEDETAIL,
                data = { },
                dataForm = {
                    id:this.id
                }
                common.requestAjax(url,JSON.stringify(data),dataForm,(res)=>{
                if(res.status == 200){
                    let data = res.data;
                    if(!data.bussData) return;
                    this.information= data.bussData
                    this.fileName = data.bussData.attachmentFile&&data.bussData.attachmentFile.fileName?data.bussData.attachmentFile.fileName:''
                }
            })
        },
    linkTo(link,id){
        this.$router.push({path: link, query: {id: id}})
    },
    handleRemove(file, fileList) {      // 图片上传
        this.information.attachmentId = '';
    },       
    handleFileSuccess(res, file) {
            if(res.status == 200){
                let picItem = res.data.bussData;
                this.information.attachmentId = picItem.fileId;
                this.fileName = picItem.fileName;
            }
    },
    confrimBtn(formName){
        let info = this.information;
          if(!info.rptDate){
              this.errorState = true
              return;
          }
        //   if(!info.rptMaster){
        //       this.errorState1 = true
        //       return;
        //   }
          if(!info.isCheck){
              this.errorState2 = true
              return;
          }
          if(!info.currency){
              this.errorState3 = true
              return;
          }
          this.information.userId = this.userId;
        this.$refs[formName].validate((valid) => {
            if (valid) {
                for (let i in this.information) {
                    if(i!='attachmentId'&&i!='id'&&i!='userId'){
                        if(!this.information[i]){
                            this.information[i] = '0'
                        }
                    }
                }
                this.information.totalCurrentLiability =this.totalNum3;
                this.information.totLiabShrhldrEqy =this.totalNum7;
                this.information.totNonCurLiab =this.totalNum4;
                this.information.totEquity =this.totalNum6;
                this.information.totLiab =this.totalNum5;
                this.information.totNonCurAssets =this.totalNum1;
                this.information.totAssets =this.totalNum2;
                this.information.totalCurrentLiability =this.totalNum3;
                this.information.currentAssets =this.totalNum;
                let url = CONSTANT.URL.SYSTEM.SAVEFINANCEBALANCESHEET;
                let param = JSON.stringify(this.information);
                common.requestAjax(url, param, null, res => {
                    if(res.status == 200) {
                        this.$message({
                            type: 'success',
                            message: '保存成功!'
                        });
                        this.$router.push('/partner/financialInfo_v2/financialBalance?id='+this.userId+'&name='+this.name+'&userId='+this.information.associationId)
                    } else {
                        this.$message({
                            type: 'error',
                            message: res.msg
                        });
                    }
                });
            } else {
                return false;
            }
            });
    },
  }
}
</script>

<style lang="scss">
.balance-edit{
    padding-bottom: 60px;
    margin-top: 30px;
    .el-form-item{
        margin-bottom: 0;
    }
    .balance-head{
         padding-top:30px;
         padding-left: 30px;
         background-color: #fff;
        .balance-title{
            font-size: 16px;
            color: #ED7018;
        }
        .balance-search{
            margin-top: 22px;
            overflow: hidden;
            .balance-item{
                position: relative;
                height: 40px;
                line-height: 40px;
                font-size: 14px;
                color: #111;
                float: left;
                margin-right: 25px;
                margin-bottom: 30px;
                .error-tip{
                    position: absolute;
                    bottom: -74%;
                    left: 31%;
                    color: #f56c6c;
                    font-size: 12px;
                }
                .el-date-editor{
                    width: 165px;
                }
                .el-input{
                    width: 165px;
                }
                .el-select{
                    width: 145px;
                }
                .upload-demo{
                    display: inline-block;
                    .btn{   
                            display: inline-block;
                            width: 80px;
                            height: 30px;
                            margin-left: 0px;
                            background-color: #ED7018;
                            border-radius: 4px;
                            -webkit-border-radius: 4px;
                            font-size: 14px;
                            color: #fff;
                            text-align: center;
                            line-height: 30px;
                            margin-right: 0px;
                            cursor: pointer;
                            &:hover{
                                background-color: #ED9000;
                                transition:all .2s linear
                            } 
                        }
                }
            }
        }
    }
    .balance-wrap{
        background-color: #fff;
        padding-top:30px;
        padding-left: 30px;
        margin-top: 20px;
        overflow: hidden;
        .el-form{
            overflow: hidden;
        }
        .el-form-item__error{
            top: 67%;
            left: 36%;
        }
        .btns-bottom{
            overflow: hidden;
             margin-left: 30%;
             padding-bottom: 60px;
             margin-top: 40px;
            .btn{
                float: left;
                width: 126px;
                height: 40px;
                margin-left: 0px;
                background-color: #ED7018;
                border-radius: 4px;
                -webkit-border-radius: 4px;
                font-size: 14px;
                color: #fff;
                text-align: center;
                line-height: 40px;
                margin-right: 0px;
                cursor: pointer;
                &:hover{
                    background-color: #ED9000;
                    transition:all .2s linear
                } 
            }
            .btn-cancel{
                float: left;
                width: 126px;
                height: 40px;
                margin-left: 0px;
                background-color: #fff;
                border: 1px solid #999;
                border-radius: 4px;
                -webkit-border-radius: 4px;
                font-size: 14px;
                color: #fff;
                text-align: center;
                line-height: 40px;
                margin-right: 0px;
                cursor: pointer;
                color: #000;
                margin-left: 61px;
            }
        }
        .balance-line{
            width: 48%;
            float: left;
        }
        .balance-title{
            span{
                font-size: 16px;
                color: #ED7018;
            }
            .tip{
                font-size: 16px;
                color: #ED7018;
            }
        }
        .balance-item{
            font-size: 14px;
            color: #111;
            margin-bottom: 20px;
            
            span{
                display: inline-block;
                width:35%;
                text-align: right;
            }
            .tip{
                display: inline-block;
                width: 60%;
            }
        }
    }
}
a {
  color: inherit;
}

.message {
  display: block;
  position: relative;
  width: 60%;
  height: 30px;/*关键样式*/
  overflow: hidden;
}
.marquee_list{
  display: block;
  position: absolute;
  top:0;
  left: 0;
}
.marquee_top{transition: top 0.5s ;}/*关键样式*/
.marquee_list li{
  height: 30px;/*关键样式*/
  line-height: 30px;/*关键样式*/
  font-size: 14px;
  padding-left: 20px;
  background-color: #fff;
  a {
      color: #333;
  }
}
.container {
  .mb30 {
    margin-bottom: 30px;
  }
  .whiteSpace {
    white-space: nowrap;
  }
  .focus-pointer {
    font-size: 14px;
    height: 70px;
    line-height: 70px;
    background-color: #fff;
    padding-left: 18px;
    white-space: nowrap;
  }
  header {
    margin: 19px 0;
    font-size: 14px;
    color: #333;
    a {
      color: #999;
    }
  }
}

main {
  position: relative;
  margin-top: 30px;
  background-color: #fff;
  padding-left: 37px;
  padding-top: 29px;
}

.tab {
  display: flex;
  height: 28px;
  padding-bottom: 18px;
}

.btn-group {
  position: absolute;
  right: 40px;
  top: 18px;
  display: flex;
  justify-content: flex-end;
  z-index: 999;
  cursor: pointer;
}

.btn-group>.btn {
  margin-left: 50px;
  height: 40px;
  width: 100px;
  color: #ffffff;
  border-radius: 6px;
  font-size: 18px;
  line-height: 42px;
  text-align: center;
  font-weight: 400;
}

.btn-group>.btn:first-child {
  background-color: rgb(225, 132, 73);
}

.btn-group>.btn:last-child {
  background-color: rgb(44, 53, 65);
}

.tab-item {
  position: relative;
  height: 17px;
  line-height: 17px;
  font-size: 17px;
  margin-right: 29px;
  font-weight: 500;
}

.tab-item.active {
  color: rgb(225, 132, 73);
}

.tab-item.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  bottom: -11px;
  background-color: rgb(225, 132, 73);
}

.view {
  background-color: #ffffff;
  padding-left: 35px;
  padding-bottom: 35px;
}
</style>
